package com.onpositive.data.serializer.readers;

import java.io.File;
import java.io.UnsupportedEncodingException;

public class RemoteStringReader extends RemoteByteArrayReader{

	public RemoteStringReader( File cache, Downloader loader) {
		super(Object.class, cache, loader);
	}

	@Override
	public Object getObject(int i) {
		byte[] object = (byte[]) super.getObject(i);
		try {
			return new String(object,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			throw new IllegalStateException(e);
		}		
	}
}
